<?php include 'inc/top.php';?>
<?php include 'inc/menu_top.php';?>
<?php include 'inc/boxtop.php';?>
<div id="home">
<?php 
	$sql = "SELECT c.cate_name ,  c.cate_id , c.cate_link FROM tb_category c  WHERE c.cate_parent_status = '0' ";
	$query = mysql_query($sql);
	while ($data = mysql_fetch_array($query) ){
?>
		<div id="boxcategory" style="min-height:230px;">
			<div id="title_category">
		    	<div class="cate1"><a href="<?php echo $data["cate_link"].'?page=1';?>"><?php echo $data["cate_name"] ?></a></div>
		    </div>
		  	<?php 
		  	$sql_small = "SELECT c.cate_id, c.cate_name , c.cate_link
		  			  FROM tb_category c
		  			  WHERE c.cate_parent_id = '".$data["cate_id"]."' ";
		  	$query_small = mysql_query($sql_small);
		  	$i = 1;
		  	while ($data_small = mysql_fetch_array($query_small)){
		  		?>
		  		<div id="boxproduct" style="border-left:none">
			    	<div class="image"><img src="http://themeviet.org/data/theme_tivi.jpg" /></div>
			    	<div class="title" style="height:20px"><a href="<?php echo $data_small["cate_link"]?>?cate_id=<?php echo $data_small["cate_id"].'&page=1'?>"><?php echo $data_small["cate_name"]?></a></div>
	    		</div>
		  	<?php
				$i++;
				if ($i%4==0){
					echo "<br>";
				}
		  	}	
			 ?>
		 </div>  
<?php }?>
			
		<img id="loader_image" src="style/images/gif/loading_black.gif"  alt="loading...">
</div>
<?php include 'inc/sidebar_right.php';?>
<?php include 'inc/bottom.php';?>